Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion for Active Record .where queries #526

Merged
merged 4 commits into from
Jan 6, 2025

Conversation

ChallaHalla
Copy link
Contributor

@ChallaHalla ChallaHalla commented Nov 15, 2024

Closes: #369

Adding ActiveRecord .where completion suggestions.

I've chosen to only provide suggestions once the user begins typing the name of the column to filter by. This is slightly different than the spec in the ticket. I don't think the call_node_enter listener can be used if suggestions are to be provided before the user begins typing a column name.

Happy to investigate this further! But I think this can be added as a follow up in another PR since the approach for when to begin suggesting seems like it should be different.

Here are some videos of how this looks!

vscode-demo.mov
neo-vim-demo.mov

lib/ruby_lsp/ruby_lsp_rails/completion.rb Outdated Show resolved Hide resolved
lib/ruby_lsp/ruby_lsp_rails/completion.rb Outdated Show resolved Hide resolved
@andyw8
Copy link
Contributor

andyw8 commented Nov 26, 2024

This may also help: Shopify/ruby-lsp#2913

@ChallaHalla
Copy link
Contributor Author

Planning on finishing and hopefully shipping this PR during hackdays next week!

@ChallaHalla ChallaHalla changed the title 369 completion for activerecord queries Completion for Active Record .where queries Dec 12, 2024
@ChallaHalla ChallaHalla force-pushed the 369-completion-for-activerecord-queries branch 2 times, most recently from 0b09971 to 896ba66 Compare December 12, 2024 05:00
@ChallaHalla ChallaHalla marked this pull request as ready for review December 12, 2024 05:00
@ChallaHalla ChallaHalla requested a review from a team as a code owner December 12, 2024 05:00
@ChallaHalla ChallaHalla force-pushed the 369-completion-for-activerecord-queries branch 3 times, most recently from 7077b8b to 44cbede Compare December 12, 2024 05:32
@ChallaHalla ChallaHalla force-pushed the 369-completion-for-activerecord-queries branch from 44cbede to def281a Compare December 12, 2024 05:32
@ChallaHalla ChallaHalla requested a review from andyw8 December 12, 2024 05:34
Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Left some style comments

lib/ruby_lsp/ruby_lsp_rails/completion.rb Outdated Show resolved Hide resolved
lib/ruby_lsp/ruby_lsp_rails/completion.rb Outdated Show resolved Hide resolved
lib/ruby_lsp/ruby_lsp_rails/completion.rb Outdated Show resolved Hide resolved
lib/ruby_lsp/ruby_lsp_rails/completion.rb Outdated Show resolved Hide resolved
lib/ruby_lsp/ruby_lsp_rails/completion.rb Outdated Show resolved Hide resolved
lib/ruby_lsp/ruby_lsp_rails/completion.rb Outdated Show resolved Hide resolved
lib/ruby_lsp/ruby_lsp_rails/completion.rb Show resolved Hide resolved
Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! This is awesome

@vinistock vinistock merged commit 906212c into main Jan 6, 2025
28 checks passed
@vinistock vinistock deleted the 369-completion-for-activerecord-queries branch January 6, 2025 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completion for ActiveRecord queries
3 participants